bitkeeper revision 1.1327.1.22 (42767ae6pMJH90d_vWODEW1wraCMTg)
authordjm@kirby.fc.hp.com <djm@kirby.fc.hp.com>
Mon, 2 May 2005 19:09:26 +0000 (19:09 +0000)
committerdjm@kirby.fc.hp.com <djm@kirby.fc.hp.com>
Mon, 2 May 2005 19:09:26 +0000 (19:09 +0000)
Oops, reenable swiotlb (more last round :-)

.rootkeys
xen/arch/ia64/lib/Makefile
xen/arch/ia64/patch/linux-2.6.11/swiotlb.c [new file with mode: 0644]
xen/arch/ia64/tools/mkbuildtree
xen/arch/ia64/xenmisc.c

index c18887a54ae3c4d9d2ecd08ab202eb58dac82e08..f89bc459b4b1575e8cb4c7be8e8f0e6755764d37 100644 (file)
--- a/.rootkeys
+++ b/.rootkeys
 425ae516EWaNOBEnc1xnphTbRmNZsw xen/arch/ia64/patch/linux-2.6.11/processor.h
 425ae516LecDyXlwh3NLBtHZKXmMcA xen/arch/ia64/patch/linux-2.6.11/series
 425ae516RFiPn2CGkpJ21LM-1lJcQg xen/arch/ia64/patch/linux-2.6.11/setup.c
+425ae516FX_10YaKGMU8Ysf7kkdm_A xen/arch/ia64/patch/linux-2.6.11/swiotlb.c
 425ae516p4ICTkjqNYEfYFxqULj4dw xen/arch/ia64/patch/linux-2.6.11/system.h
 425ae516juUB257qrwUdsL9AsswrqQ xen/arch/ia64/patch/linux-2.6.11/time.c
 425ae5167zQn7zYcgKtDUDX2v-e8mw xen/arch/ia64/patch/linux-2.6.11/tlb.c
index b5125f632b6ffec03422e4e6a65260ace5d40172..a181d5166dc590d2603d13078d0a12feb60d063d 100644 (file)
@@ -9,7 +9,7 @@ OBJS := __divsi3.o __udivsi3.o __modsi3.o __umodsi3.o                   \
        bitop.o checksum.o clear_page.o csum_partial_copy.o copy_page.o \
        clear_user.o strncpy_from_user.o strlen_user.o strnlen_user.o   \
        flush.o ip_fast_csum.o do_csum.o copy_user.o                    \
-       memset.o strlen.o memcpy.o
+       memset.o strlen.o memcpy.o swiotlb.o
 
 default: $(OBJS)
        $(LD) -r -o ia64lib.o $(OBJS)
diff --git a/xen/arch/ia64/patch/linux-2.6.11/swiotlb.c b/xen/arch/ia64/patch/linux-2.6.11/swiotlb.c
new file mode 100644 (file)
index 0000000..77fff5e
--- /dev/null
@@ -0,0 +1,77 @@
+ swiotlb.c |   21 +++++++++++++--------
+ 1 files changed, 13 insertions(+), 8 deletions(-)
+
+Index: linux-2.6.11-xendiffs/arch/ia64/lib/swiotlb.c
+===================================================================
+--- linux-2.6.11-xendiffs.orig/arch/ia64/lib/swiotlb.c 2005-04-08 12:13:54.040202667 -0500
++++ linux-2.6.11-xendiffs/arch/ia64/lib/swiotlb.c      2005-04-08 12:19:09.170367318 -0500
+@@ -124,8 +124,11 @@ swiotlb_init_with_default_size (size_t d
+       /*
+        * Get IO TLB memory from the low pages
+        */
+-      io_tlb_start = alloc_bootmem_low_pages(io_tlb_nslabs *
+-                                             (1 << IO_TLB_SHIFT));
++      /* FIXME: Do we really need swiotlb in HV? If all memory trunks
++       * presented to guest as <4G, are actually <4G in machine range,
++       * no DMA intevention from HV...
++       */
++      io_tlb_start = alloc_xenheap_pages(get_order(io_tlb_nslabs * (1 << IO_TLB_SHIFT)));
+       if (!io_tlb_start)
+               panic("Cannot allocate SWIOTLB buffer");
+       io_tlb_end = io_tlb_start + io_tlb_nslabs * (1 << IO_TLB_SHIFT);
+@@ -135,16 +138,16 @@ swiotlb_init_with_default_size (size_t d
+        * to find contiguous free memory regions of size up to IO_TLB_SEGSIZE
+        * between io_tlb_start and io_tlb_end.
+        */
+-      io_tlb_list = alloc_bootmem(io_tlb_nslabs * sizeof(int));
++      io_tlb_list = alloc_xenheap_pages(get_order(io_tlb_nslabs * sizeof(int)));
+       for (i = 0; i < io_tlb_nslabs; i++)
+               io_tlb_list[i] = IO_TLB_SEGSIZE - OFFSET(i, IO_TLB_SEGSIZE);
+       io_tlb_index = 0;
+-      io_tlb_orig_addr = alloc_bootmem(io_tlb_nslabs * sizeof(char *));
++      io_tlb_orig_addr = alloc_xenheap_pages(get_order(io_tlb_nslabs * sizeof(char *)));
+       /*
+        * Get the overflow emergency buffer
+        */
+-      io_tlb_overflow_buffer = alloc_bootmem_low(io_tlb_overflow);
++      io_tlb_overflow_buffer = alloc_xenheap_pages(get_order(io_tlb_overflow));
+       printk(KERN_INFO "Placing software IO TLB between 0x%lx - 0x%lx\n",
+              virt_to_phys(io_tlb_start), virt_to_phys(io_tlb_end));
+ }
+@@ -328,13 +331,13 @@ swiotlb_alloc_coherent(struct device *hw
+        */
+       flags |= GFP_DMA;
+-      ret = (void *)__get_free_pages(flags, order);
++      ret = (void *)alloc_xenheap_pages(get_order(size));
+       if (ret && address_needs_mapping(hwdev, virt_to_phys(ret))) {
+               /*
+                * The allocated memory isn't reachable by the device.
+                * Fall back on swiotlb_map_single().
+                */
+-              free_pages((unsigned long) ret, order);
++              free_xenheap_pages((unsigned long) ret, order);
+               ret = NULL;
+       }
+       if (!ret) {
+@@ -372,7 +375,7 @@ swiotlb_free_coherent(struct device *hwd
+ {
+       if (!(vaddr >= (void *)io_tlb_start
+                     && vaddr < (void *)io_tlb_end))
+-              free_pages((unsigned long) vaddr, get_order(size));
++              free_xenheap_pages((unsigned long) vaddr, get_order(size));
+       else
+               /* DMA_TO_DEVICE to avoid memcpy in unmap_single */
+               swiotlb_unmap_single (hwdev, dma_handle, size, DMA_TO_DEVICE);
+@@ -388,8 +391,10 @@ swiotlb_full(struct device *dev, size_t 
+        * When the mapping is small enough return a static buffer to limit
+        * the damage, or panic when the transfer is too big.
+        */
++#ifndef XEN
+       printk(KERN_ERR "PCI-DMA: Out of SW-IOMMU space for %lu bytes at "
+              "device %s\n", size, dev ? dev->bus_id : "?");
++#endif
+       if (size > io_tlb_overflow && do_panic) {
+               if (dir == PCI_DMA_FROMDEVICE || dir == PCI_DMA_BIDIRECTIONAL)
index 0a60d12faf842f596386351bf72933571e71c60a..5ffbd3efc873d1cd2bcad69bbd63c92417f951ed 100644 (file)
@@ -142,7 +142,7 @@ softlink arch/ia64/lib/strlen_user.S arch/ia64/lib/strlen_user.S
 softlink arch/ia64/lib/strncpy_from_user.S arch/ia64/lib/strncpy_from_user.S
 softlink arch/ia64/lib/strnlen_user.S arch/ia64/lib/strnlen_user.S
 #softlink arch/ia64/lib/swiotlb.c arch/ia64/lib/swiotlb.c
-#cp_patch arch/ia64/lib/swiotlb.c arch/ia64/lib/swiotlb.c swiotlb.c
+cp_patch arch/ia64/lib/swiotlb.c arch/ia64/lib/swiotlb.c swiotlb.c
 softlink arch/ia64/lib/xor.S arch/ia64/lib/xor.S
 
 softlink lib/cmdline.c arch/ia64/cmdline.c
@@ -151,19 +151,19 @@ softlink arch/ia64/hp/sim/hpsim.S arch/ia64/hpsim.S
 
 # xen/include/asm-generic files
 
-softlink include/asm-generic/bug.h include/asm-generic/bug.h bug.h
-softlink include/asm-generic/div64.h include/asm-generic/div64.h div64.h
+softlink include/asm-generic/bug.h include/asm-generic/bug.h
+softlink include/asm-generic/div64.h include/asm-generic/div64.h
 softlink include/asm-generic/errno.h include/asm-generic/errno.h
 softlink include/asm-generic/errno-base.h include/asm-generic/errno-base.h
-softlink include/asm-generic/ide_iops.h include/asm-generic/ide_iops.h ide_iops.h
-softlink include/asm-generic/iomap.h include/asm-generic/iomap.h iomap.h
-softlink include/asm-generic/pci-dma-compat.h include/asm-generic/pci-dma-compat.h pci-dma-compat.h
-softlink include/asm-generic/pci.h include/asm-generic/pci.h pci.h
-softlink include/asm-generic/pgtable.h include/asm-generic/pgtable.h pgtable.h
-softlink include/asm-generic/pgtable-nopud.h include/asm-generic/pgtable-nopud.h pgtable-nopud.h
-softlink include/asm-generic/sections.h include/asm-generic/sections.h sections.h
-softlink include/asm-generic/topology.h include/asm-generic/topology.h topology.h
-softlink include/asm-generic/vmlinux.lds.h include/asm-generic/vmlinux.lds.h vmlinux.lds.h
+softlink include/asm-generic/ide_iops.h include/asm-generic/ide_iops.h
+softlink include/asm-generic/iomap.h include/asm-generic/iomap.h
+softlink include/asm-generic/pci-dma-compat.h include/asm-generic/pci-dma-compat.h
+softlink include/asm-generic/pci.h include/asm-generic/pci.h
+softlink include/asm-generic/pgtable.h include/asm-generic/pgtable.h
+softlink include/asm-generic/pgtable-nopud.h include/asm-generic/pgtable-nopud.h
+softlink include/asm-generic/sections.h include/asm-generic/sections.h
+softlink include/asm-generic/topology.h include/asm-generic/topology.h
+softlink include/asm-generic/vmlinux.lds.h include/asm-generic/vmlinux.lds.h
 
 
 # xen/include/asm-ia64 files
index 290b3296ab51ac81b9f371857c4053e92f49f3e6..335e7d16c3c71367a6b9b303cd5ab512e0e49c80 100644 (file)
@@ -33,7 +33,7 @@ void ia64_patch_vtop(unsigned long a, unsigned long b) { }
 void hpsim_setup(char **x) { }
 
 // called from mem_init... don't think s/w I/O tlb is needed in Xen
-void swiotlb_init(void) { }
+//void swiotlb_init(void) { }  ...looks like it IS needed
 
 long
 is_platform_hp_ski(void)